package cn.java81.mychool.test;

import cn.java81.mychool.dao.SubjectDao;
import cn.java81.mychool.entity.Subject;

import java.util.List;
import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class SubjectDaotest {
    public static void main(String[] args) {
        SubjectDao dao=new SubjectDao();
        Scanner in=new Scanner(System.in);
        while (true){
            System.out.println("1:新增，2：删除，3：修改，4：查询，9：退出");
            int ch=in.nextInt();
            if (ch ==1) {

            }else if(ch==4){
                System.out.println("一页多少条：");
                int pageSize=in.nextInt();
                System.out.println("要查第几页：");
                int pageNo=in.nextInt();
                List<Subject> datas = dao.search(pageNo, pageSize);
                datas.forEach(System.out::println);
            }else if(ch==9){
                break;
            }
        }
    }
}
